var constructor_ = Function.constructor;
Function.constructor = Function.prototype.constructor = function(value){
    //debugger;
    if(value=='debugger'){
        return constructor_.call(this,'');
    }else{
        return constructor_.call(this,value)
    }
};
re_obj = {
    're_': [],
    'exec_': {
        count_: 0
    },
    'replace_': {
        count_: 0
    },
    'test_': {
        count_: 0
    },
    'count_': 0
};
var console_ = console.log;
console.log = function(){};
alert = function(){};
setInterval = function(){};
setTimeout = function(){};
clearInterval = function(){};
clearTimeout = function(){};
function clear_debu(x1){
    xxx_ = x1.toString().replace(/debugger/g,'');
    xxx_ = xxx_.replace(/global/g,'undefined');
    xxx_ = xxx_.replace(/debu_/g,'debugger');
    console_('明文debugger已清除！');
    return xxx_;
    // window[x1.name]();
};

(function(){
    var match_ = String.prototype.match;
    String.prototype.match = function() {
        var res = match_.apply(this, arguments);
        if (typeof (arguments[0]) == 'object') {
            console_(this)
            console_(arguments[0] + '  ===>  ' + 'replace_' + '  ==>  ' + res);
            debugger ;
        }
        ;return res;
    }
    var matchall_ = String.prototype.matchall;
    String.prototype.matchall = function() {
        var res = matchall_.apply(this, arguments);
        if (typeof (arguments[0]) == 'object') {
            console_(this)
            console_(arguments[0] + '  ===>  ' + 'matchall_' + '  ==>  ' + res);
            debugger ;
        }
        ;return res;
    }
    var search_ = String.prototype.search;
    String.prototype.search = function() {
        var res = search_.apply(this, arguments);
        if (typeof (arguments[0]) == 'object') {
            console_(this)
            console_(arguments[0] + '  ===>  ' + 'search_' + '  ==>  ' + res);
            debugger ;
        }
        ;return res;
    }
    var replace_ = String.prototype.replace;
    String.prototype.replace = function() {
        var res = re_obj.replace_[arguments[0]];
        if (res) {
            return res;
        }
        var res = replace_.apply(this, arguments);
        re_obj['replace_'][arguments[0].toString()] = res;
        re_obj['replace_']['count_'] += 1;
        if (typeof (arguments[0]) == 'object') {
            console_(this)
            console_(arguments[0] + '  ===>  ' + 'replace' + '  ==>  ' + res);
            debugger ;
        }
        ;return res;
    }
    var test_ = RegExp.prototype.test;
    RegExp.prototype.test = function() {
        var res = re_obj.test_[this.toString()];
        if (res) {
            return res;
        }
        var res = test_.apply(this, arguments)
        re_obj['test_'][this.toString()] = res;
        re_obj['test_']['count_'] += 1;
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'test' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var exec_ = RegExp.prototype.exec;
    RegExp.prototype.exec = function() {
        var res = re_obj.exec_[this.toString()];
        if (typeof (res) != 'undefined') {
            return res;
        }
        var res = exec_.apply(this, arguments);
        re_obj['exec_'][this.toString()] = res;
        re_obj['exec_']['count_'] += 1;
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'exec' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var compile_ = RegExp.prototype.compile;
    RegExp.prototype.compile = function() {
        var res = compile_.apply(this, arguments)
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'compile' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var match__ = RegExp.prototype.match;
    RegExp.prototype.match = function() {
        var res = match__.apply(this, arguments)
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'match__' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var search__ = RegExp.prototype.search;
    RegExp.prototype.search = function() {
        var res = search__.apply(this, arguments)
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'search__' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var replace__ = RegExp.prototype.replace;
    RegExp.prototype.replace = function() {
        var res = replace__.apply(this, arguments);
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'replace__' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var matchall__ = RegExp.prototype.matchall;
    RegExp.prototype.matchall = function() {
        var res = matchall__.apply(this, arguments)
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'matchall__' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    var split = RegExp.prototype.split;
    RegExp.prototype.split = function() {
        var res = split.apply(this, arguments);
        if (typeof (this) == 'object') {
            console_(this + '  ===>  ' + 'split' + '  ==>  ' + res);
            debugger
        }
        ;return res;
    }
    // hook 普通构造方法/fads/  和函数构造方法
    var regexp = RegExp;
    RegExp = function() {
        if (re_obj.re_.indexOf(arguments[0]) != -1) {
            return regexp.apply(this, arguments);
        }
        re_obj['re_'].push(arguments[0]);
        re_obj.count_ += 1;
        console_('get===>' + arguments[0]);
        debugger ;return regexp.apply(this, arguments);
    }
})
;

function proxy(obj) {
    return new Proxy(obj,{
        set(obj, prop, value) {
            var objName = obj.name || obj.toString().replace(/\[|\]/g, '').split(' ')[1];
            var value_ = value.toString();
            console_('set：' + objName + '[' + prop + ']' + '===>' + value_);
            debugger;
            return Reflect.set.apply(this, arguments);
        },
        get(obj, prop) {
            var objName = obj.name || obj.toString().replace(/\[|\]/g, '').split(' ')[1];
            var value = obj[prop];
            if(!value){
                var value_ = value;
            }else{var value_ = value.toString()}
            console_('get：' + objName + '[' + prop + ']' + '===>' + value_);
            debugger;
            return value;
        }
    })
}
;
document = class document{};
document.name = 'document';
window = global;
window.name = 'window';
window.crypto = {};
window.crypto.getRandomValues = function(int_array){
    var arry_len = int_array.length;
    for(var i=0;i<arry_len;i++){
        arry_len[i] = parseInt(Math.random()*Math.pow(10,10))
    };
    return int_array;
}
navigator = class navigator{};
window = proxy(window);